<article id="wikiArticle">
<div></div>
<p><code><strong>Function.prototype</strong></code> 属性存储了 <a href="Reference/Function" title="此页面仍未被本地化, 期待您的翻译!"><code>Function</code></a> 的原型对象。</p>
<h2 id="Description" name="Description">描述</h2>
<p><a href="Reference/Function" title="此页面仍未被本地化, 期待您的翻译!"><code>Function</code></a><code>对象继承自 Function.prototype 属性</code><code>。因此，Function.prototype</code> 不能被修改。</p>
<h2 id="属性">属性</h2>
<dl>
<dt><a href="Reference/Global_Objects/Function/arguments" title="function.arguments 属性代表传入函数的实参，它是一个类数组对象。"><code>Function.arguments</code></a> <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span></dt>
<dd>以数组形式获取传入函数的所有参数。此属性已被<a href="Reference/Functions_and_function_scope/arguments" title="此页面仍未被本地化, 期待您的翻译!"><code>arguments</code></a>替代。</dd>
<dt><s class="obsoleteElement"><a href="Reference/Global_Objects/Function/arity" title="返回一个函数的形参数量."><code>Function.arity</code></a> <span class="icon-only-inline" title="This is an obsolete API and is no longer guaranteed to work."><i class="icon-trash"> </i></span></s></dt>
<dd><s class="obsoleteElement">用于指定的函数的参数的个数，但已被删除。使用<a href="Reference/Global_Objects/Function/length" title="此页面仍未被本地化, 期待您的翻译!"><code>length</code></a>属性代替。</s></dd>
<dt><a href="Reference/Global_Objects/Function/caller" title="返回调用指定函数的函数."><code>Function.caller</code></a> <span class="icon-only-inline" title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></dt>
<dd>获取调用函数的具体对象。</dd>
<dt><a href="Reference/Global_Objects/Function/length" title="此页面仍未被本地化, 期待您的翻译!"><code>Function.length</code></a></dt>
<dd>获取函数的接收参数个数。</dd>
<dt><a href="Reference/Global_Objects/Function/name" title="name 属性返回一个函数声明的名称。"><code>Function.name</code></a> <span class="icon-only-inline" title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></dt>
<dd>获取函数的名称。</dd>
<dt><a href="Reference/Global_Objects/Function/displayName" title="function.displayName 属性获取函数的显示名称"><code>Function.displayName</code></a> <span class="icon-only-inline" title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></dt>
<dd>获取函数的display name。</dd>
<dt><code>Function.prototype.constructor</code></dt>
<dd>声明函数的原型构造方法，详细请参考 <a href="Reference/Global_Objects/Object/constructor" title='返回创建实例对象的 Object 构造函数的引用。注意，此属性的值是对函数本身的引用，而不是一个包含函数名称的字符串。对原始类型来说，如1，true和"test"，该值只可读。'><code>Object.constructor</code></a> 。</dd>
</dl>
<h2 id="方法">方法</h2>
<dl>
<dt><a href="Reference/Global_Objects/Function/apply" title="apply() 方法调用一个具有给定this值的函数，以及作为一个数组（或类似数组对象）提供的参数。"><code>Function.prototype.apply()</code></a></dt>
<dd>在一个对象的上下文中应用另一个对象的方法；参数能够以数组形式传入。</dd>
<dt><a href="Reference/Global_Objects/Function/bind" title="bind()方法创建一个新的函数，在调用时设置this关键字为提供的值。并在调用新函数时，将给定参数列表作为原函数的参数序列的前若干项。"><code>Function.prototype.bind()</code></a></dt>
<dd><span style="font-family: courier new,andale mono,monospace; line-height: 1.5;">bind()</span>方法会创建一个新函数,称为绑定函数.当调用这个绑定函数时,绑定函数会以创建它时传入 <span style="font-family: courier new,andale mono,monospace;">bind()</span>方法的第一个参数作为 <span style="font-family: courier new,andale mono,monospace;">this</span>,传入 <span style="font-family: courier new,andale mono,monospace;">bind()</span>方法的第二个以及以后的参数加上绑定函数运行时本身的参数按照顺序作为原函数的参数来调用原函数.</dd>
<dt><a href="Reference/Global_Objects/Function/call" title="call() 方法调用一个函数, 其具有一个指定的this值和分别地提供的参数(参数的列表)。"><code>Function.prototype.call()</code></a></dt>
<dd>在一个对象的上下文中应用另一个对象的方法；参数能够以列表形式传入。</dd>
<dt><a href="Reference/Global_Objects/Function/isGenerator" title="判断一个函数是否是一个生成器."><code>Function.prototype.isGenerator()</code></a> <span class="icon-only-inline" title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></dt>
<dd><code>若函数对象为</code><a href="Guide/Iterators_and_Generators">generator</a>，返回true，反之返回 <code>false</code>。</dd>
<dt><a href="Reference/Global_Objects/Function/toSource" title="返回函数的源代码的字符串表示."><code>Function.prototype.toSource()</code></a> <span class="icon-only-inline" title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></dt>
<dd>获取函数的实现源码的字符串。 覆盖了 <a href="Reference/Global_Objects/Object/toSource" title="toSource()方法返回一个表示对象源代码的字符串。"><code>Object.prototype.toSource</code></a> 方法。</dd>
<dt><a href="Reference/Global_Objects/Function/toString" title="toString() 方法返回一个表示当前函数源代码的字符串。"><code>Function.prototype.toString()</code></a></dt>
<dd>获取函数的实现源码的字符串。覆盖了 <a href="Reference/Global_Objects/Object/toString" title="toString() 方法返回一个表示该对象的字符串。"><code>Object.prototype.toString</code></a> 方法。</dd>
</dl>
<h2 id="规范">规范</h2>
<table class="standard-table">
<tbody>
<tr>
<th scope="col">规范</th>
<th scope="col">状态</th>
<th scope="col">说明</th>
</tr>
<tr>
<td><a class="external" href="https://www.ecma-international.org/publications/files/ECMA-ST-ARCH/ECMA-262,%201st%20edition,%20June%201997.pdf" hreflang="en" lang="en" rel="noopener" title="ECMAScript 1st Edition (ECMA-262)">ECMAScript 1st Edition (ECMA-262)</a></td>
<td><span class="spec-Standard">Standard</span></td>
<td>Initial definition.Implemented in JavaScript 1.1</td>
</tr>
<tr>
<td><a class="external" href="https://www.ecma-international.org/ecma-262/5.1/#sec-15.3.5.2" hreflang="en" lang="en" rel="noopener">ECMAScript 5.1 (ECMA-262)<br/><small lang="zh-CN">Function.prototype</small></a></td>
<td><span class="spec-Standard">Standard</span></td>
<td> </td>
</tr>
<tr>
<td><a class="external" href="https://www.ecma-international.org/ecma-262/6.0/#sec-function-instances-prototype" hreflang="en" lang="en" rel="noopener">ECMAScript 2015 (6th Edition, ECMA-262)<br/><small lang="zh-CN">Function.prototype</small></a></td>
<td><span class="spec-Standard">Standard</span></td>
<td> </td>
</tr>
</tbody>
</table>
<h2 id="浏览器兼容性">浏览器兼容性</h2>
<p></p><div class="blockIndicator warning"><strong><a class="external" href="https://github.com/mdn/browser-compat-data" rel="noopener">We're converting our compatibility data into a machine-readable JSON format</a></strong>.
            This compatibility table still uses the old format,
            because we haven't yet converted the data it contains.
            <strong><a class="new" href="/zh-CN/docs/MDN/Contribute/Structures/Compatibility_tables" rel="nofollow">Find out how you can help!</a></strong></div>
<div class="htab">
<a id="AutoCompatibilityTable" name="AutoCompatibilityTable"></a>
<ul>
<li class="selected"><a>Desktop</a></li>
<li><a>Mobile</a></li>
</ul>
</div><p></p>
<div id="compat-desktop">
<table class="compat-table">
<tbody>
<tr>
<th>Feature</th>
<th>Chrome</th>
<th>Firefox (Gecko)</th>
<th>Internet Explorer</th>
<th>Opera</th>
<th>Safari</th>
</tr>
<tr>
<td>Basic support</td>
<td><span style="color: #888;" title="Please update this with the earliest version of support.">(Yes)</span></td>
<td><span style="color: #888;" title="Please update this with the earliest version of support.">(Yes)</span></td>
<td><span style="color: #888;" title="Please update this with the earliest version of support.">(Yes)</span></td>
<td><span style="color: #888;" title="Please update this with the earliest version of support.">(Yes)</span></td>
<td><span style="color: #888;" title="Please update this with the earliest version of support.">(Yes)</span></td>
</tr>
</tbody>
</table>
</div>
<div id="compat-mobile">
<table class="compat-table">
<tbody>
<tr>
<th>Feature</th>
<th>Android</th>
<th>Chrome for Android</th>
<th>Firefox Mobile (Gecko)</th>
<th>IE Mobile</th>
<th>Opera Mobile</th>
<th>Safari Mobile</th>
</tr>
<tr>
<td>Basic support</td>
<td><span style="color: #888;" title="Please update this with the earliest version of support.">(Yes)</span></td>
<td><span style="color: #888;" title="Please update this with the earliest version of support.">(Yes)</span></td>
<td><span style="color: #888;" title="Please update this with the earliest version of support.">(Yes)</span></td>
<td><span style="color: #888;" title="Please update this with the earliest version of support.">(Yes)</span></td>
<td><span style="color: #888;" title="Please update this with the earliest version of support.">(Yes)</span></td>
<td><span style="color: #888;" title="Please update this with the earliest version of support.">(Yes)</span></td>
</tr>
</tbody>
</table>
</div>
<h2 id="参考">参考</h2>
<ul>
<li><a href="Reference/Function" title="此页面仍未被本地化, 期待您的翻译!"><code>Function</code></a></li>
</ul>
</article>